package com.etcxy.type;

import java.util.Iterator;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App1 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		ApplicationContext ac = new ClassPathXmlApplicationContext(
				"com/etcxy/type/beans.xml");
		placeDemo pd = (placeDemo) ac.getBean("where");
		pd.sayHi();
		System.out.println("**********给数组赋值*************");
		String[] weathers = pd.getWeather();
		for (String string : weathers) {
			System.out.println(pd.getPlace() + " " + string);
		}

		System.out.println("*********通过list取出数据************");
		List<com.etcxy.type.weather> weatherList = pd.getWeatherList();
		for (Iterator iterator = weatherList.iterator(); iterator.hasNext();) {
			weather weather = (weather) iterator.next();
			System.out.println(pd.getPlace() + " " + weather.getType());
		}
		

	}

}
